<?php
$this->display('public/header.phtml', array(
    "title"    => "示例列表",
    "styles"   => '',
    "crumbArr" => array(
        array("title" => "示例管理"),
    ),
));
?>

<div class="row">
    <div class="col-xs-12">
        <div class="row">
            <div class="col-xs-12">
                <button id="modal-alert" class="btn-sm btn btn-primary">提示信息</button>
                <div class="space-4"></div>

                <!-- <div class="dataTables_borderWrap"> -->
                <table id="sample-table-1" class="table table-striped table-bordered table-hover">
                    <thead>
                        <tr>
                            <th class="center">
                                <label class="position-relative">
                                    <input type="checkbox" class="ace" />
                                    <span class="lbl"></span>
                                </label>
                            </th>
                            <th>编号</th>
                            <th>姓名</th>
                            <th>注册时间</th>
                            <th class="hidden-480">登录IP</th>
                            <th></th>
                        </tr>
                    </thead>

                    <tbody>
                        <?php foreach ($result as $row): ?>
                            <tr>
                                <td class="center">
                                    <label class="position-relative">
                                        <input type="checkbox" class="ace" />
                                        <span class="lbl"></span>
                                    </label>
                                </td>
                                <td><?php echo $row['id']; ?> </td>
                                <td><?php echo $row['name']; ?> </td>
                                <td><?php echo date("Y-m-d H:i:s", $row['add_time']); ?></td>
                                <td class="hidden-480"><?php echo $row['ip'] ?></td>
                                <td>
                                    <div class="action-buttons">
                                        <a class="blue list-demo" href="javascript:void(0);">
                                            <i class="ace-icon fa fa-search-plus bigger-130"></i>
                                        </a>

                                        <a class="green update-demo" href="#">
                                            <i class="ace-icon fa fa-pencil bigger-130"></i>
                                        </a>

                                        <a class="red" href="#">
                                            <i class="ace-icon fa fa-trash-o bigger-130"></i>
                                        </a>
                                    </div>

                                    <div class="hidden-md hidden-lg">
                                        <div class="inline position-relative">
                                            <button class="btn btn-minier btn-yellow dropdown-toggle" data-toggle="dropdown" data-position="auto">
                                                <i class="ace-icon fa fa-caret-down icon-only bigger-120"></i>
                                            </button>

                                            <ul class="dropdown-menu dropdown-only-icon dropdown-yellow dropdown-menu-right dropdown-caret dropdown-close">
                                                <li>
                                                    <a href="#" class="tooltip-info" data-rel="tooltip" title="View">
                                                        <span class="blue">
                                                            <i class="ace-icon fa fa-search-plus bigger-120"></i>
                                                        </span>
                                                    </a>
                                                </li>

                                                <li>
                                                    <a href="#" class="tooltip-success" data-rel="tooltip" title="Edit">
                                                        <span class="green">
                                                            <i class="ace-icon fa fa-pencil-square-o bigger-120"></i>
                                                        </span>
                                                    </a>
                                                </li>

                                                <li>
                                                    <a href="#" class="tooltip-error" data-rel="tooltip" title="Delete">
                                                        <span class="red">
                                                            <i class="ace-icon fa fa-trash-o bigger-120"></i>
                                                        </span>
                                                    </a>
                                                </li>
                                            </ul>
                                        </div>
                                    </div>
                                </td>
                            </tr>
                        <?php endforeach; ?>
                    </tbody>
                </table>
                <?php $this->display('public/pagination.phtml', array('paginator' => $this->paginator->style1())); ?>
            </div>
        </div>
    </div><!-- /.col -->
</div><!-- /.row -->


<?php
$this->display("public/footer.phtml", array(
    "scripts" => '<script src="/admin_resources/assets/js/jquery.dataTables.min.js"></script>
<script src="/admin_resources/assets/js/jquery.dataTables.bootstrap.js"></script>'
));
?>
<?php $this->display("public/list_footer.phtml"); ?>
<script type="text/javascript">
    $(".list-demo").click(function () {
        our.modalAjaxList({
            title: "列表demo2",
            width: "80%",
            ajax: {
                url: "/admin/demo/ajaxlist/",
                type: "GET",
            }
        });
    });

    $("#modal-alert").click(function () {
        our.modalAlert({
            title: "提示框",
            width: "40%",
            content: "你好",
        });
    });

    $(".update-demo").click(function () {
        $.ajax({
            url: "/admin/demo/ajaxform/",
            type: "GET",
            success: function (res) {
                $(".modal-content").html(res);
                $(".modal-dialog").css("width", "800px");
                $('#modal-table').modal();
            },
            error: function () {
            }
        });
    });
</script>

</body>
</html>